/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: XHCI driver Vendor Hooks
 */

#ifdef CONFIG_NETBIOS_TPM_SPEC

#ifndef __TPM_TIS_EXT_H__
#define __TPM_TIS_EXT_H__
#include <linux/tpm.h>
#include "tpm.h"
#include "tpm_tis_core.h"

#undef ioread8
#undef ioread16
#undef ioread32
#undef iowrite8
#undef iowrite32

/* io functions redefined by product code */
int tpm_read8(const void *addr);
int tpm_read16(const void *addr);
int tpm_read32(const void *addr);
void tpm_write8(const void *addr, u8 value);
void tpm_write32(const void *addr, u8 value);

#define ioread8(_addr) tpm_read8(_addr)
#define ioread16(_addr) tpm_read16(_addr)
#define ioread32(_addr) tpm_read32(_addr)
#define iowrite8(_val, _addr) tpm_write8(_addr, _val)
#define iowrite32(_val, _addr) tpm_write32(_addr, _val)
/* these functions defined by product code */
void trace_tpm_tis_dfx_show(struct tpm_chip *chip, struct tpm_tis_data *priv);
void trace_tpm_tis_recv_wait(struct tpm_chip *chip);
#endif

#else

struct tpm_chip;
struct tpm_tis_data;

static inline void trace_tpm_tis_dfx_show(struct tpm_chip *chip, struct tpm_tis_data *priv)
{
}

static inline void trace_tpm_tis_recv_wait(struct tpm_chip *chip)
{
}
#endif
